package com.wk.springboot.thread;

public class ThreadTest {

    public static void main(String[] args) throws InterruptedException {
        final String obj = "";

        Thread thread1 = new Thread(new MyThread("thread1",obj));
        Thread thread2 = new Thread(new MyThread("thread2",obj));

        thread1.start();
        thread2.start();
        System.out.println("线程已经启动");
        Thread.sleep(1000);
        thread1.interrupt();
        thread2.interrupt();

        System.out.println("主线程运行完毕");
    }

}
